package chai.ning.wrapper1;

/**
 * 1、valueOf 回的是包装类类型的对象
 * 2、parseXxx( String s ) 返回的是基本数据类型的值
 */
public class ParseTest1 {

	public static void main(String[] args) {
		
		final String s = "101" ;
		
		Integer x = Integer.valueOf( s );
		System.out.println( x + " : " + x.getClass().getName() );
		
		Integer y = Integer.valueOf( s , 2 );
		System.out.println( y + " : " + y.getClass().getName() );
		
		System.out.println( "- - - - - - - - - - - -" );
		
		byte b = Byte.parseByte( s );
		System.out.println( b );
		
		short h = Short.parseShort( s );
		System.out.println( h );
		
		int p = Integer.parseInt( s );
		System.out.println( p );
		
		long o = Long.parseLong( s );
		System.out.println( o );
		
		float f = Float.parseFloat( s );
		System.out.println( f );
		
		double d = Double.parseDouble( s );
		System.out.println( d );
		
		boolean z = Boolean.parseBoolean( s );
		System.out.println( z );
		
		z = Boolean.parseBoolean( "TrUE" );
		System.out.println( z );
		
	}

}
